import json

from elasticsearch import Elasticsearch

es = Elasticsearch([{'host': '39.108.176.217', 'port': 9200}])
result = es.search(query={"match_all": {}})
print(result)
print(json.dumps(result, ensure_ascii=False, indent=4))
# query = {
#     "query": {
#         "match_all": {}
#     }
# }
# result = es.search(index="my_index", body=query)
# print(result)
# for hit in result["hits"]["hits"]:
#     print(hit["_source"])

id = "58jIfpkBPgHVl09LI1cf"
result = es.delete(index="my_index", id=id)
print(result)
